home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 May / Disc 2 / PCU0503CD2.iso / Crystal / Samples / CPP / 32bit / Mycall / MAINFRM.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-18  |  2.6 KB  |  123 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MYCALL.h"
  6. #include "../../crpe.h"
  7. #include "MainFrm.h"
  8. #include <fstream.h>
  9. #include "SelectEv.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16.  
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CMainFrame
  20.  
  21. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  22.  
  23. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  24.     //{{AFX_MSG_MAP(CMainFrame)
  25.     ON_WM_CREATE()
  26.  
  27.     ON_COMMAND(ID_APP_EXIT, OnAppExit)
  28.         
  29.     //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31.  
  32. static UINT indicators[] =
  33. {
  34.     ID_STATUSBARUPDATE,           // status line indicator
  35.     ID_INDICATOR_CAPS,
  36.     ID_INDICATOR_NUM,
  37.     ID_INDICATOR_SCRL,
  38. };
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CMainFrame construction/destruction
  42.  
  43. CMainFrame::CMainFrame()
  44. {
  45.     // TODO: add member initialization code here
  46.     
  47. }
  48.  
  49. CMainFrame::~CMainFrame()
  50. {
  51. }
  52.  
  53. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  54. {
  55.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  56.         return -1;
  57.     
  58.     if (!m_dialogBar.Create(this,IDD_CURSORBAR ,CBRS_TOP,
  59.         IDD_CURSORBAR))
  60.         
  61.     {
  62.         TRACE0("Failed to create DIALOG BAR\n");
  63.         return -1;      // fail to create
  64.     }
  65.     
  66.     
  67.     if (!m_wndStatusBar.Create(this) ||
  68.         !m_wndStatusBar.SetIndicators(indicators,
  69.           sizeof(indicators)/sizeof(UINT)))
  70.     {
  71.         TRACE0("Failed to create status bar\n");
  72.         return -1;      // fail to create
  73.     }
  74.     m_wndStatusBar.SetPaneInfo(0,ID_STATUSBARUPDATE, SBPS_STRETCH, 60);
  75.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  76. //    m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  77. //        CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  78.  
  79.     // TODO: Delete these three lines if you don't want the toolbar to
  80.     //  be dockable
  81. //    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  82. //    EnableDocking(CBRS_ALIGN_ANY);
  83. //    DockControlBar(&m_wndToolBar);
  84.  
  85.     return 0;
  86. }
  87.  
  88. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  89. {
  90.     // TODO: Modify the Window class or styles here by modifying
  91.     //  the CREATESTRUCT cs
  92.     return CFrameWnd::PreCreateWindow(cs);
  93. }
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CMainFrame diagnostics
  97.  
  98. #ifdef _DEBUG
  99. void CMainFrame::AssertValid() const
  100. {
  101.     CFrameWnd::AssertValid();
  102. }
  103.  
  104. void CMainFrame::Dump(CDumpContext& dc) const
  105. {
  106.     CFrameWnd::Dump(dc);
  107. }
  108.  
  109. #endif //_DEBUG
  110.  
  111. /////////////////////////////////////////////////////////////////////////////
  112. // CMainFrame message handlers
  113.  
  114.  
  115. void CMainFrame::OnAppExit() 
  116. {
  117.     // TODO: Add your command handler code here
  118.  
  119.     OnClose();
  120. }
  121.  
  122.  
  123.